<template>
	<div class="container">
		<div class="l-box flex-column">
			<view class="d-box flex-align-center" v-if="!$store.state.user.isSpecificAccount || !item.isSpecificAccount"
				v-for="(item, i) in navList" :key="i" @click="itemHandle(item)">
				<image class="icon" :src="item.imageUrl" mode="aspectFill" />
				<text class="title">{{ item.title }}</text>
				<text class="iconfont icon-Downarrow-R iconfont-right"></text>
			</view>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				type: 'term', //term:机具 ,data: 数据查询,tripartiteData:平行代理数据
				navList: [],
				termList: [{
						title: '机具明细',
						url: '/pages/home/terminal/index',
						imageUrl: require('@/common/images/termial/terminal-icon1.png')
					},
					{
						title: '机具划拨',
						url: '/pages/home/terminal/operation?type=assign',
						imageUrl: require('@/common/images/termial/terminal-icon2.png'),
						isSpecificAccount: true
					},
					{
						title: '机具回拨',
						url: '/pages/home/terminal/operation?type=back',
						imageUrl: require('@/common/images/termial/terminal-icon3.png'),
						isSpecificAccount: true
					},
					// {
					// 	title: '机具回收',
					// 	url: '/pages/home/terminal/operation?type=recycle',
					// 	imageUrl: require('@/common/images/termial/terminal-icon3.png'),
					// 	isSpecificAccount: true
					// },
					{
						title: '回拨记录',
						url: '/pages/home/terminal/termBackList',
						imageUrl: require('@/common/images/termial/terminal-icon3.png'),
						isSpecificAccount: true
					},
					// ,
					// {
					// 	title: '解绑/绑定',
					// 	url: '/pages/home/terminal/terminalList',
					// 	imageUrl: require('@/common/images/termial/terminal-icon4.png'),
					// 	isSpecificAccount: true
					// }
					// {
					//   title: "机具押金",
					//   url: "/pages/home/terminal/terminalList",
					//   imageUrl: require("@/common/images/termial/terminal-icon5.png"),
					// },
					// {
					//   title: "费率修改",
					//   url: "/pages/home/terminal/terminalList",
					//   imageUrl: require("@/common/images/termial/terminal-icon6.png"),
					// },
					{
					  title: "修改终端品牌",
					  url: "/pages/home/terminal/brandModification",
					  imageUrl: require("@/common/images/termial/terminal-icon6.png"),
					},
				],
				dataList: [{
						title: '交易分润',
						url: '/pages/home/statistics/index?type=0',
						imageUrl: require('@/common/images/termial/terminal-icon1.png')
					},
					// {
					// 	title: '伪激活查询',
					// 	url: '/pages/home/statistics/index?type=1',
					// 	imageUrl: require('@/common/images/termial/terminal-icon2.png')
					// },
					// {
					// 	title: '达标查询',
					// 	url: '/pages/home/statistics/index?type=2',
					// 	imageUrl: require('@/common/images/termial/terminal-icon3.png')
					// },
					{
						title: '服务费查询',
						url: '/pages/home/statistics/index?type=3',
						imageUrl: require('@/common/images/termial/terminal-icon4.png')
					},
					{

						title: '通讯费分账查询',
						url: '/pages/home/statistics/index?type=4',
						imageUrl: require('@/common/images/termial/terminal-icon4.png')
					},
					{
						title: '通讯费扣款查询',
						url: '/pages/home/statistics/index?type=7',
						imageUrl: require('@/common/images/termial/terminal-icon4.png')
					},
					// {
					// 	title: '激活分账查询',
					// 	url: '/pages/home/statistics/index?type=5',
					// 	imageUrl: require('@/common/images/termial/terminal-icon4.png')
					// },
					// {
					// 	title: '提现手续费分账查询',
					// 	url: '/pages/home/statistics/index?type=6',
					// 	imageUrl: require('@/common/images/termial/terminal-icon4.png')
					// }
				],
				policyList: [{
						url: '/pages/home/policy/open',
						imageUrl: require('@/common/images/policy/open.png'),
						title: '产品开通'
					},
					{
						url: '/pages/home/policy/queryPolicy',
						imageUrl: require('@/common/images/policy/query_policy.png'),
						title: '政策查询'
					},
					// {
					// 	url: '/pages/home/policy/changeServiceFee',
					// 	imageUrl: require('@/common/images/policy/query_policy.png'),
					// 	title: '变更服务费'
					// },
					// {
					// 	url: '/pages/home/policy/changeMerchRate',
					// 	imageUrl: require('@/common/images/policy/query_policy.png'),
					// 	title: '变更商户费率'
					// },
					// {
					// 	url: '/pages/home/price-property/price-property',
					// 	imageUrl: require('@/common/images/policy/query_policy.png'),
					// 	title: '调价分成配置'
					// },
					// {
					// 	url: '/pages/home/price-property-detail/price-property-detail',
					// 	imageUrl: require('@/common/images/policy/query_policy.png'),
					// 	title: '调价分成明细'
					// }
				],
				tripartiteData: [{
						title: '商户信息',
						url: '/pages/home/home/merch-info?type=preMerch',
						imageUrl: require('@/common/images/tripartiteData/icon1.png')
					},
					{
						title: '终端查询',
						url: '/pages/home/terminal/terminalList?routeType=pre',
						imageUrl: require('@/common/images/termial/terminal-icon1.png')
					},
					{
						title: '终端绑定信息',
						url: '/pages/home/tripartiteData/merchBindTerm',
						imageUrl: require('@/common/images/termial/terminal-icon4.png')
					},
					{
						title: '交易查询',
						url: '/pages/home/trading/index?routeType=pre',
						imageUrl: require('@/common/images/tripartiteData/icon2.png')
					},
					{
						title: '伪激活查询',
						url: '/pages/home/statistics/index?routeType=pre&type=1',
						imageUrl: require('@/common/images/tripartiteData/icon3.png')
					},
					{
						title: '商户达标考核',
						url: '/pages/home/tripartiteData/merchStandardCheck',
						imageUrl: require('@/common/images/tripartiteData/icon4.png')
					},
					{
						title: '商户终端激活',
						url: '/pages/home/tripartiteData/activationCheck',
						imageUrl: require('@/common/images/tripartiteData/icon5.png')
					}
				],
				feeManageList: [
					{
						url: '/pages/home/policy/changeServiceFee',
						imageUrl: require('@/common/images/policy/query_policy.png'),
						title: '变更服务费'
					},
					{
						url: '/pages/home/policy/changeMerchRate',
						imageUrl: require('@/common/images/policy/query_policy.png'),
						title: '变更商户费率'
					}
				]
			};
		},
		created() {},
		onLoad(option) {
			console.log(option);
			this.type = option.type;
			switch (this.type) {
				case 'term':
					this.navList = this.termList;
					uni.setNavigationBarTitle({
						title: '机具管理'
					});
					break;
				case 'data':
					this.navList = this.dataList;
					uni.setNavigationBarTitle({
						title: '数据查询'
					});
					break;
				case 'policy':
					this.navList = this.policyList;
					uni.setNavigationBarTitle({
						title: '政策管理'
					});
					break;
				case 'tripartiteData':
					this.navList = this.tripartiteData;
					uni.setNavigationBarTitle({
						title: '平行代理查询'
					});
					break;
				case 'feeManage':
					this.navList = this.feeManageList;
					uni.setNavigationBarTitle({
						title: '费率管理'
					});
					break;
				default:
					this.navList = this.termList;
					uni.setNavigationBarTitle({
						title: '机具管理'
					});
					break;
			}
		},
		methods: {
			itemHandle(item) {
				this.$nav.push({
					path: item.url
				});
			}
		}
	};
</script>
<style scoped lang="scss">
	.container {
		padding-top: R(10);
	}

	.l-box {
		flex-wrap: wrap;
		padding: R(0) R(25) R(20) R(20);
		border-radius: R(10);
		background: #fff;

		// height: R(220);

		.d-box {
			flex: 1;
			padding: R(18) 0;
		}

		// :not(:last-child)
		.d-box {
			border-bottom: 1px solid #eee;
		}

		.title {
			font-size: R(28px);
			font-family: Source Han Sans CN;
			font-weight: 400;
			color: #000;
			margin-left: R(20);
		}

		.icon {
			width: R(70);
			height: R(70);
			// font-weight: bold;
			// margin: 0 auto R(10);
		}

		.margin1 {
			margin-bottom: R(30);
		}

		.iconfont {
			margin-left: auto;
			font-size: R(38);
		}
	}
</style>